unit uFrmTeleVendas;

interface

uses
  Windows,
  Messages,
  SysUtils,
  Variants,
  Classes,
  Graphics,
  Controls,
  Forms,
  dTeleVendas,
  ZConnection,
  Dialogs,
  ExtCtrls,
  Menus,
  DB,
  ActnList,
  ImgList,
  StdCtrls,
  Grids,
  DBGrids,
  Buttons,
  Mask,
  NumericEdit,
  dVendas,
  ComCtrls,
  ToolWin;

type
  TFrmTeleVendas = class(TForm)
    cbMain: TCoolBar;
    ToolBar2: TToolBar;
    btnHelp: TToolButton;
    ToolButton1: TToolButton;
    btnFiltros: TToolButton;
    ToolButton2: TToolButton;
    btnRecuperaNota: TToolButton;
    tbMain: TToolBar;
    tbsSeparator2: TToolButton;
    ToolBar1: TToolBar;
    btn_Sair: TToolButton;
    ToolButton6: TToolButton;
    btnDesfaz: TToolButton;
    ToolBar3: TToolBar;
    pnVenda: TPanel;
    pnVendaTop: TPanel;
    pnAdd: TPanel;
    gbPesquisa: TGroupBox;
    btnItem: TSpeedButton;
    EdtPesquisa: TEdit;
    Panel7: TPanel;
    pnItem: TPanel;
    cbAdd: TGroupBox;
    EdtValorUnit: TNumericEdit;
    Panel12: TPanel;
    EdtQtde: TNumericEdit;
    Panel21: TPanel;
    btnIncluir: TBitBtn;
    Panel4: TPanel;
    EdtPerDeconto: TNumericEdit;
    edtValTotal: TNumericEdit;
    Panel5: TPanel;
    EdtValPrecoVenda: TNumericEdit;
    Panel2: TPanel;
    gbVenda: TGroupBox;
    gridPreVenda: TDBGrid;
    GroupBox2: TGroupBox;
    Panel3: TPanel;
    Panel22: TPanel;
    EdtTotalLiquido: TNumericEdit;
    Panel6: TPanel;
    Panel9: TPanel;
    EdtValDesconto: TNumericEdit;
    Panel8: TPanel;
    Panel18: TPanel;
    EdtTotalBruto: TNumericEdit;
    GroupBox3: TGroupBox;
    btnFinanceiro: TBitBtn;
    btnGravar: TBitBtn;
    Panel1: TPanel;
    gbClifor: TGroupBox;
    SpeedButton4: TSpeedButton;
    btnPesquisa: TSpeedButton;
    pnCliFor: TPanel;
    EdtCliFor: TEdit;
    Panel14: TPanel;
    GroupBox1: TGroupBox;
    Label5: TLabel;
    BitBtn1: TBitBtn;
    cbVendedor: TComboBox;
    imgFiles: TImageList;
    ActionList1: TActionList;
    AcSelOperacao: TAction;
    AcDesfaz: TAction;
    AcClose: TAction;
    AcPesquisaCliFor: TAction;
    AcPesquisaItem: TAction;
    AcExcluirItem: TAction;
    acGravar: TAction;
    DSPadrao1: TDataSource;
    PopupMenu1: TPopupMenu;
    ExcluirItematual1: TMenuItem;
    procedure btn_SairClick(Sender: TObject);
    procedure btnGravarClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    class procedure TeleVendas( ASender : TComponent; AConexao : TZConnection; AConsulta : boolean);

  end;

var
  FrmTeleVendas: TFrmTeleVendas;

implementation

{$R *.dfm}

{ TFrmTeleVendas }

class procedure TFrmTeleVendas.TeleVendas(ASender: TComponent;
  AConexao: TZConnection; AConsulta: boolean);
begin
 with Self.Create( ASender ) do
   begin
   try
   // ZQuery1.Connection := AConexao;
   // MostrarAtivos;
   // gbManutencao.Visible := not AConsulta;
    ShowModal;
   finally
    Destroy;
   end;
  end;
end;

procedure TFrmTeleVendas.btn_SairClick(Sender: TObject);
begin
  Close;
end;

procedure TFrmTeleVendas.btnGravarClick(Sender: TObject);
var
 FEstoque : TEstoque;
begin

 try
  FEstoque := TEstoque.Create;
  FEstoque.Gravar;


 finally
  FreeAndNil( FEstoque );
 end;

end;

end.
